SETRecord Option in Subform Control...?

sivaguru_ksr
Member Posts: 100
Hello,
Consider Sales Order contains 100 Item lines...In that 99 th line is an dropshipment line which linked to an PO and receipted.Now what is required is ...From Receipt line,we need to jump to Sales order and in Subform-->Current record should point to 99 th line by default
and also Sales order displayed should be in non-editable by default.
when i tried the concept of SETRecord...i am getting an error 'Sales line cannot be modified in this form' may be because of non editable state...
In editable state also, i am getting an 'Do you want to rename a record'.
Any solution to achieve this requirement..?
Consider Sales Order contains 100 Item lines...In that 99 th line is an dropshipment line which linked to an PO and receipted.Now what is required is ...From Receipt line,we need to jump to Sales order and in Subform-->Current record should point to 99 th line by default
and also Sales order displayed should be in non-editable by default.
when i tried the concept of SETRecord...i am getting an error 'Sales line cannot be modified in this form' may be because of non editable state...
In editable state also, i am getting an 'Do you want to rename a record'.
Any solution to achieve this requirement..?
0
Answers
-
Best is to create a singleinstancecodeunit in which you put the line to which the salesorder should jump. This function must be called JUST before running the salesform.
Function SalesOrderLineNoSet(IintLineNo AS INTEGER); intLineNo := IintLineNo; blnMainFormNotEditable := FALSE;
In the sales header main form, in the OnOpenForm, you can call a function to check if the mainform must be editable or not.Function IsSalesOrderEditable OblnReturnValue AS BOOLEAN OblnReturnValue := blnMainFormNotEditable; blnMainFormNotEditable := FALSE; //needed to avoid that from that moment, the main form will always be non-editable
In the OnOpenForm of the subform, call this function to now where to position:Function SalesOrderLineNoGet : OintReturnValue AS INTEGER; OintReturnValue := intLineNo; intLineNo := 0;
Code for the OnOpenForm of the subform:intLineNo := cduSingInstanceCodeunit.SalesOrderLineNoGet(); IF intLineNo <> THEN BEGIN SETRANGE("Line No.",intLineNo); END;
Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Thanks kriki...
i will do as you said above and let you know the feedback.0 -
Hello Kriki,
In OnOpenForm of Sales Order Subform...you have used
intLineNo := cduSingInstanceCodeunit.SalesOrderLineNoGet();
IF intLineNo <> THEN BEGIN
SETRANGE("Line No.",intLineNo);
END;
Setrange...will filter only that particular record...
I need to display all the Lines...but Currecord should be the one from receipt line(Sales order Line No.)
Thanks0 -
Try this:
intLineNo := cduSingInstanceCodeunit.SalesOrderLineNoGet(); IF intLineNo <> THEN BEGIN GET("Document Type","Document No.",intLineNo); END;
In case the get gives an error, that he doesn't find the record with Document No = blank, then use this:intLineNo := cduSingInstanceCodeunit.SalesOrderLineNoGet(); IF intLineNo <> THEN BEGIN FINDFIRST; GET("Document Type","Document No.",intLineNo); END;
Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Hello,
when we use Get in OnOpenform for CurRec...it says SalesLine Does not Exist...eventhough Salesline Exists..
we are not able to use Get in OnOpenForm....
Thanks0 -
Do you get the error also if you use the example with the FINDFIRST in it?Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
try using
IF GET() THEN;0 -
Hello,
if we use FINDFIRST...then we need to provide filter condition too..
but we need to display all the records...only the record pointer should be moved appropriately...0 -
Hello kriki,
Findfirst along with Get option working fine....
Thank you0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions