Skip to Content
0

Row order in Form Settings

Jun 13, 2017 at 09:58 AM

54

avatar image
Former Member

Hi,

I want from code to do in my form row ordering like is it working on Form Settings.

To do that you have to open form settings of any form. On table format pane you have rows which can be manually ordered. You have to hold left mouse button on a row and then you can reorder rows with your persolized requirement.

Below is link to film which present what I want to accomplish.

Link to film of row ordering

Any suggenstions?

Kind Regards

Sebastian

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

DIEGO LOTHER Jun 17, 2017 at 08:50 PM
1

Hi Sebastian,

If you are familiarize with SAP Business One SDK, you can achieve this purpose with the FormPreferencesService object.

A sample:

	SAPbobsCOM.CompanyService oCmpSrv = oCompany.GetCompanyService();
	FormPreferencesService oFormPreferencesService = oCmpSrv.GetBusinessService(ServiceTypes.FormPreferencesService);
	ColumnsPreferencesParams oColPreferencesParams = oFormPreferencesService.GetDataInterface(FormPreferencesServiceDataInterfaces.fpsdiColumnsPreferencesParams);
	//form type 
	oColPreferencesParams.FormID = formType;
	//user id (e.g manager= 1)
	oColPreferencesParams.User = userID;
	//get columns preferences 
	ColumnsPreferences oColsPreferences = oFormPreferencesService.GetColumnsPreferences(oColPreferencesParams);


	//walk the among the columns
	for (int j = 0; j <= oColsPreferences.Count - 1; j++)
	{
		
		//Find the column that you want - In this sample I want the column Item Number("1") from item content matrix ("38") on sales order form("139")
		if (oColsPreferences.Item(j).Column == "1" && oColsPreferences.Item(j).ItemNumber == "38") //Find the column that you want - In this sample
		{
			//Update de position of the "Item Number" column
			oColsPreferences.Item(j).TabsLayout = 2;
		}
	}
	//Then, commit the changes.
	oFormPreferencesService.UpdateColumnsPreferences(oColPreferencesParams, oColsPreferences);

Hope it helps.

Kind Regards,

Diego Lother

Share
10 |10000 characters needed characters left characters exceeded