Employee Portal : Modify Line Issue

vipinkuruvillavipinkuruvilla Member Posts: 143
edited 2009-01-20 in Navision e-Commerce
Hai All,

Following is my code for modifying a line in a header-line web part :


ReturnCode := 0;
FilterString :=
STRSUBSTNO('WHERE(1=CONST(%1),3=CONST(%2))',
DecodeXML.GetValueByFieldIDFromLineData(XMLDocInLine,TomList.FIELDNO(No)),
DecodeXML.GetValueByFieldIDFromLineData(XMLDocInLine,TomList.FIELDNO(LineNo)));

LineRecordRef.OPEN(DATABASE::TomList,FALSE);
LineRecordRef.SETVIEW(FilterString);

xLineRecordRef.OPEN(DATABASE::TomList,FALSE);
xLineRecordRef.SETVIEW(FilterString);

IF xLineRecordRef.FIND('-') THEN;

IF SupportFunctions.CompareHashValues(DecodeXML.GetHashValue(XMLDocInLine),LineRecordRef) THEN BEGIN
EncodeXML.AddFieldToValidationDoc(XMLDocValField,TomList.FIELDNO(No));
EncodeXML.AddFieldToValidationDoc(XMLDocValField,TomList.FIELDNO(Mark1));
EncodeXML.AddFieldToValidationDoc(XMLDocValField,TomList.FIELDNO(Mark2));
EncodeXML.AddFieldToValidationDoc(XMLDocValField,TomList.FIELDNO(Mark3));
EncodeXML.AddFieldToValidationDoc(XMLDocValField,TomList.FIELDNO(Total));
EncodeXML.AddFieldToValidationDoc(XMLDocValField,TomList.FIELDNO(Average));


DecodeXML.ModifyRecord(XMLDocInLine,LineRecordRef,XMLDocValField,DATABASE::TomList,
FALSE,TRUE,AdditionalValues[1],AdditionalValues[2]);

LineRecordRef.MODIFY(TRUE);
END ELSE BEGIN
ReturnCode := 20;
END;

LineFieldRef := LineRecordRef.FIELD(TomList.FIELDNO(No));
tmpvalue := LineFieldRef.VALUE;

SupportFunctions.CreateTempHeadFilterTable(TomList.FIELDNO(No),tmpvalue,GUID);
SupportFunctions.CreateTempHeadFilterKeys(TomList.FIELDNO(No),GUID);


Please take a note that TomHeader is my record variable.

Also No,Mark1 and Mark2 are my keys.

Iam getting a error : "Navision error (10500): You cannot enter 'ERROR))' in Integer. The cursor is in front of the invalid character. "

Did anyone come across this error?? Please do advice me....

Thanx in advance...

Comments

  • krikikriki Member, Moderator Posts: 9,112
    [Topic moved from Navision forum to Navision e-Commerce forum]
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • DynamicUserDynamicUser Member Posts: 177
    STRSUBSTNO('WHERE(1=CONST(%1),3=CONST(%2))'

    please correct the syntax. your error will get resolve.
  • vipinkuruvillavipinkuruvilla Member Posts: 143
    That issue is solved........The problem was I didnt declare all my keys to the Line Record Ref variable. But After modifying my code to this :
    
    ReturnCode := 0;
    FilterString :=
    STRSUBSTNO('WHERE(1=CONST(%1),2=CONST(%2),3=CONST(%3),7=CONST(%4))',
        DecodeXML.GetValueByFieldIDFromLineData(XMLDocInLine,TomList.FIELDNO(No)),
        DecodeXML.GetValueByFieldIDFromLineData(XMLDocInLine,TomList.FIELDNO(Mark1)),
        DecodeXML.GetValueByFieldIDFromLineData(XMLDocInLine,TomList.FIELDNO(Mark2)),
        DecodeXML.GetValueByFieldIDFromLineData(XMLDocInLine,TomList.FIELDNO(LineNo)));
    
    LineRecordRef.OPEN(DATABASE::TomList,FALSE);
    LineRecordRef.SETVIEW(FilterString);
    
    xLineRecordRef.OPEN(DATABASE::TomList,FALSE);
    xLineRecordRef.SETVIEW(FilterString);
    
    IF xLineRecordRef.FIND('-') THEN;
    
    IF SupportFunctions.CompareHashValues(DecodeXML.GetHashValue(XMLDocInLine),LineRecordRef) THEN BEGIN
      EncodeXML.AddFieldToValidationDoc(XMLDocValField,TomList.FIELDNO(No));
      EncodeXML.AddFieldToValidationDoc(XMLDocValField,TomList.FIELDNO(Mark1));
      EncodeXML.AddFieldToValidationDoc(XMLDocValField,TomList.FIELDNO(Mark2));
      EncodeXML.AddFieldToValidationDoc(XMLDocValField,TomList.FIELDNO(Mark3));
      EncodeXML.AddFieldToValidationDoc(XMLDocValField,TomList.FIELDNO(Total));
      EncodeXML.AddFieldToValidationDoc(XMLDocValField,TomList.FIELDNO(Average));
    
    
      DecodeXML.ModifyRecord(XMLDocInLine,LineRecordRef,XMLDocValField,DATABASE::TomList,
        FALSE,TRUE,AdditionalValues[1],AdditionalValues[2]);
    
      LineRecordRef.MODIFY(TRUE);
    END ELSE BEGIN
      ReturnCode := 20;
    END;
    
    LineFieldRef := LineRecordRef.FIELD(TomList.FIELDNO(No));
    tmpvalue := LineFieldRef.VALUE;
    SupportFunctions.CreateTempHeadFilterTable(TomList.FIELDNO(No),tmpvalue,GUID);
    
    LineFieldRef := LineRecordRef.FIELD(TomList.FIELDNO(Mark1));
    tmpvalue := LineFieldRef.VALUE;
    SupportFunctions.CreateTempHeadFilterTable(TomList.FIELDNO(Mark1),tmpvalue,GUID);
    
    LineFieldRef := LineRecordRef.FIELD(TomList.FIELDNO(Mark2));
    tmpvalue := LineFieldRef.VALUE;
    SupportFunctions.CreateTempHeadFilterTable(TomList.FIELDNO(Mark2),tmpvalue,GUID);
    
    
    SupportFunctions.CreateTempHeadFilterTable(TomList.FIELDNO(No),tmpvalue,GUID);
    SupportFunctions.CreateTempHeadFilterKeys(TomList.FIELDNO(No),GUID);
    

    Here TomList is my record variable . Any my Primary keys are :
    1) No,Mark1,Mark2
    2) No,LineNo

    Iam getting an error like this :

    " Navision error (10500): There is not sufficient available space in the C/AL stack memory to execute this task. There are too many simultaneous activities, due to the way recursive function call is used in the program. The problem can be solved temporarily by shutting down some of the open activities (but the function still cannot be executed). "

    Can anyone tell me where I have gone wrong ?? Kindly help me out :(

    Thanx in advance.........
  • Ravi_ThakkarRavi_Thakkar Member Posts: 392
    Hi, all

    I just want to modify or create the Item Journal Lines from Employee Portal.

    Can you please suggest me, whether I need any NAVISION Customization or not?
    Please, suggest me how to do the same in any case.

    Please, help me urgentaly.
    Thanks in advance.
    Ravi_Thakkar
    Ahmedabad, Gujarat, India
    E Mail : ravi.thakkar@hotmail.com
  • Ravi_ThakkarRavi_Thakkar Member Posts: 392
    Hi all,

    I found the solution.
    For that we need to make Item Journal Line table as a Card in Employee Portal.

    And for modification of journal entries via Sharepoint, we need to write code in the Codeunits related to EP Modify Header, EP Insert Header.

    Thanks.
    Ravi_Thakkar
    Ahmedabad, Gujarat, India
    E Mail : ravi.thakkar@hotmail.com
Sign In or Register to comment.