Want Help on ShareJpoint

Apr 24, 2012 at 9:12 AM
Edited Apr 24, 2012 at 9:14 AM

Hello,

I Wrote jquery ready method...

<script type="text/ecmascript">

$(document).ready(function(){ var objDT = getQueryString("Payee");  var objTXType=getQueryString("TXType"); alert(objTXType); var Payee; if(objTXType=="Payment") { Payee=GetPayeeName(objDT); Payee=GetValueFromLookupValue(Payee); }  else if(objTXType=="Purchase Brokerage") { Payee=GetBrokName(objDT); Payee=GetValueFromLookupValue(Payee); } $("#ctl00_m_g_a63bc89e_1b9a_434f_80d5_272535cf7f3f_ff12_1").val(Payee);  });

function GetBrokName(ItemID){var CompanyDetails = GetListItemByID(ItemID,"Commission Payment Entry");alert(CompanyDetails);    if (CompanyDetails != null) {        for (var itemCounter = 0; itemCounter < CompanyDetails.length; itemCounter++) {            var CompanyItemID = jP.Lists["COMMISSION PAYMENT ENTRY"].Items[itemCounter].ID; alert(CompanyItemID);            if (CompanyItemID == ItemID)             { var CompName = jP.Lists["COMMISSION PAYMENT ENTRY"].Items[itemCounter].Broker Name;                               return CompName;            }        }    }    return '';  }

function GetPayeeName(ItemID) {    var CompanyDetails = GetListItemByID(ItemID,"PUR_SAL_Entry");
    if (CompanyDetails != null) {        for (var itemCounter = 0; itemCounter < CompanyDetails.length; itemCounter++) {            var CompanyItemID = jP.Lists["PUR_SAL_ENTRY"].Items[itemCounter].ID;             if (CompanyItemID == ItemID)             {                        var CompName = jP.Lists["PUR_SAL_ENTRY"].Items[itemCounter].CompanyID;                               return CompName;            }        }    }
    return '';}</script>

..................................................................................................................................................................................................................................................................................

Function GetPayeeName returns actual value because column name haven't space.

ex.CompanyID

But the Method GetBrokerName returns null because of Column name having space.

ex. Broker Name

 

 var CompName = jP.Lists["COMMISSION PAYMENT ENTRY"].Items[itemCounter].Broker Name; 

it returns null because of column Name having space so how to tackle this problem.

 



Coordinator
Apr 25, 2012 at 12:08 AM
Try without the spaces.

var CompName = jP.Lists["COMMISSION PAYMENT ENTRY"].Items[itemCounter].BrokerName;

To see more functions for columns with spaces and special characters, see the jPFormInspector example here: http://www.sharejpoint.com/examples/Lists/jPFormInspector/NewForm.aspx
username: demouser
password: sharejPoint!

-Will

On Tue, Apr 24, 2012 at 5:12 AM, shrikantgavade <notifications@codeplex.com> wrote:

From: shrikantgavade

Hello,

I Wrote jquery ready method...

<script type="text/ecmascript">

$(document).ready(function(){ var objDT = getQueryString("Payee"); var objTXType=getQueryString("TXType"); alert(objTXType); var Payee; if(objTXType=="Payment") { Payee=GetPayeeName(objDT); Payee=GetValueFromLookupValue(Payee); } else if(objTXType=="Purchase Brokerage") { Payee=GetBrokName(objDT); Payee=GetValueFromLookupValue(Payee); } $("#ctl00_m_g_a63bc89e_1b9a_434f_80d5_272535cf7f3f_ff12_1").val(Payee); });

function GetBrokName(ItemID){var CompanyDetails = GetListItemByID(ItemID,"Commission Payment Entry");alert(CompanyDetails); if (CompanyDetails != null) { for (var itemCounter = 0; itemCounter < CompanyDetails.length; itemCounter++) { var CompanyItemID = jP.Lists["COMMISSION PAYMENT ENTRY"].Items[itemCounter].ID; alert(CompanyItemID); if (CompanyItemID == ItemID) { var CompName = jP.Lists["COMMISSION PAYMENT ENTRY"].Items[itemCounter].Broker Name; return CompName; } } } return ''; }

function GetPayeeName(ItemID) { var CompanyDetails = GetListItemByID(ItemID,"PUR_SAL_Entry");
if (CompanyDetails != null) { for (var itemCounter = 0; itemCounter < CompanyDetails.length; itemCounter++) { var CompanyItemID = jP.Lists["PUR_SAL_ENTRY"].Items[itemCounter].ID; if (CompanyItemID == ItemID) { var CompName = jP.Lists["PUR_SAL_ENTRY"].Items[itemCounter].CompanyID; return CompName; } } }
return '';}</script>

..................................................................................................................................................................................................................................................................................

Function GetPayeeName returns actual value because column name haven't space.

ex.CompanyID

But the Method GetBrokerName returns null because of Column name having space.

ex. Broker Name

var CompName = jP.Lists["COMMISSION PAYMENT ENTRY"].Items[itemCounter].Broker Name;

it returns null because of column Name having space so how to tackle this problem.



Read the full discussion online.

To add a post to this discussion, reply to this email (jPoint@discussions.codeplex.com)

To start a new discussion for this project, email jPoint@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com