Upload File – Sharepoint

 

Hey Friends,

Many of us might have worked on different storage areas of a specific file and would have worked on several API’s to process a file to a certain location. I got one of the request from my customer where they urge to upload directly onto share-point. So I completed that stuff where they can simply upload the file and the dedicated SharePoint server will receive the file right away. Normally it will take a bit of time in Authenticating the server credentials and all for the first time then from the next time the execution time will somehow reduced. Still I will recommend not to upload directly if it could have an alternate because if it’s a big file then it could make you wait longer.

So here is the set of code which you need  to write

//RWN
ClientContext := ClientContext.ClientContext(‘URL’);
ClientContext.Credentials := NetworkCredential.NetworkCredential(‘Username’,
‘Password’,’Domain’);
FileCreationInformation := FileCreationInformation.FileCreationInformation;
FilePathL := FileManagementL.UploadFile(Text010,”);
FileCreationInformation.Content := FileContent.ReadAllBytes(FilePathL);
FileCreationInformation.Url := FileManagementL.GetFileName(FilePathL);
FileDirectoryL := FileManagementL.GetDirectoryName(FilePathL);
FileExtensionL := FileManagementL.GetExtension(FilePathL);
FileCreationInformation.Overwrite := TRUE;
Web := ClientContext.Web;
MyList := Web.Lists.GetByTitle(‘Library’);
//Folder
FolderName := MyList.RootFolder.Folders.GetByUrl(‘Folder Name’);
FolderName.Files.Add(FileCreationInformation);
//Library
MyList.RootFolder.Files.Add(FileCreationInformation);
ClientContext.ExecuteQuery;
//RWN

ClientContext DotNet

Microsoft.SharePoint.Client.ClientContext.’Microsoft.SharePoint.Client, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c’

FileCreationInformation DotNet

Microsoft.SharePoint.Client.FileCreationInformation.’Microsoft.SharePoint.Client, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c’

FileContent DotNet

System.IO.File.’mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089′

MyList DotNet

Microsoft.SharePoint.Client.List.’Microsoft.SharePoint.Client, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c’

Web DotNet

Microsoft.SharePoint.Client.Web.’Microsoft.SharePoint.Client, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c’

NetworkCredential DotNet

System.Net.NetworkCredential.’System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089′

FolderName DotNet

Microsoft.SharePoint.Client.Folder.’Microsoft.SharePoint.Client, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c’

SharepointFile DotNet

Microsoft.SharePoint.Client.File.’Microsoft.SharePoint.Client, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c’

FileLink DotNet

System.String.’mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089′

CHEERS

 

ACS Configuration Error – ACS Aunthetication

 

Hey Folks,

I just ended up with one of the error where one of my Customer was having ACS authentication to be functional for both NAV RTC and Web Clients. Event viewer of the error addresses something like this –

The service MicrosoftDynamicsNavServer$TestNav failed to start. This could be caused by a configuration error. Detailed error information: System.ServiceModel.AddressAccessDeniedException: HTTP could not register URL http://+:7047/TestNav/. Your process does not have access rights to this namespace (see http://go.microsoft.com/fwlink/?LinkId=70353 for details). —> System.Net.HttpListenerException: Access is denied

After an analysis I come into a conclusion where the port was not binded for the ACS to be functional. So here is the quick fix for this.

Open Command Prompt and execute this command –

netsh http add urlacl url=http://+:7047/TestNav/ user=”NT AUTHORITY\NETWORK SERVICE”

CHEERS

Cross-Dock

 

Hey Folks,

Once you go deep dive into Advance Warehousing then there’s many thing that comes into picture and Cross Dock is one of those method which could be very widely used once you experience this functionality and in today’s post am gonna explain this to you. Cross Dock is one of the most effective way in which you get rid of the entire Warehousing Put-Away process if the item that’s just been received can be utilised directly in the Sales order or somewhere in Production.

Am assuming you have all basic ideas of Zones and Bins and how its works in the system. So the very first thing you need to do is you have to do a basic setup for the Cross Dock bin, so navigate to your Location Card and define the bin in the Cross Dock Bin Code. Make sure the bin which you are defining is Cross Dock enabled bin.

Now after doing the setup in Location card what you need to do is you need to go back to the Item card and make sure in the Item Card too the Cross Dock is enabled.

All setup has been completed and now you have to go back to the Sales Order(Am Using Sales Order as an example) Make a new Sales Order for any an item with say 50 Quantity.

Now go back to the Purchase Order and make a Purchase of 50 quantity for the same Item for which you make the Sales Order. Now make the Whse. Receipt for the Purchase. Now enter the Quantity to Receive on Warehouse receipt and then click on Qty. to Cross-Dock on.

Here System will open a new screen for you i.e Cross Dock Opportunities. Now you have to Click on Refresh Cross-Dock Opportunities this will all bring all the respective areas from where this Item can be Cross-Docked, as I just made the Sales Order hence Sales Order for this item got appeared in front of me.

Now you have to click Auto-fill-Qty to Cross-Dock  and then do it OK. System will update the Qty to Cross-Cock section. Now Post the Receiving and this part is done.

Now if you will check you Put Away Document you will notice system is picking from the main Bin and placing it into the Cross Docked bin which you defined above. If the Bin is coming blank then simply move to right and there you will see one column which says Cross Dock Information which will make you understand like you just executed for the Cross Dock operation. If the Quantity is more in Purchase order then the quantity to be  Cross Docked then system will place the remaining quantity to the main Bins. Register the Document and complete the Put-Away.

Now go back to the same Sales Order and execute the Warehouse Shipment Process and Create the Pick for this Item. Here you will notice that system is now picking the Item from the same Cross-Dock Bin where it placed while Put Away. So that means now it Picking from the Cross Dock Bin and placing it into the Shipping Bin.

Complete the Pick Document and Post the Shipment.

CHEERS

 

Consume NAV Service – Get Item Picture

 

Hey Friends,

In my previous page I explained how to send Item picture over Web Service in a string, In this article I am gonna show how you can consume that service from C# side and show it to your Web application.

Below is the piece of code which you need to write, a bit of C# programming knowledge is needed and you are good to go.

In the E drive you will get the Image that is retrieved from NAV Side.

 

CHEERS!!

Item Picture- Webservice

 

Hey Friends,

I was just working on an assignment where I got the need of the customer like they want the Item Picture via web service. Another validation they put in was they don’t want the item picture to be saved on any particular directory instead they want on fly.

So now in standard NAV 2018 Item picture data-set has been changed from Blob to Mediaset so it was then added challenge. We need to convert the picture into streams and bytes and then we can send this over service but how to convert it into bytes. Converting Blob we all are well experienced but what about Mediaset.

There’s a new virtual table which Microsoft has introduced to maintain this identity in Blob which is Tenant Media. The reason why Microsoft did so is now we have the capability to add multiple pictures for an item.

So here is the piece of code how we are suppose to do this.

//RWN
Item.GET(ItemNo);
IF Item.Picture.COUNT = 0 THEN
EXIT(”);

TenantMedia.GET(Item.Picture.ITEM(1));
TenantMedia.CALCFIELDS(Content);
IF TenantMedia.Content.HASVALUE THEN BEGIN
CLEAR(PictureText);
CLEAR(PictureInStream);
TenantMedia.Content.CREATEINSTREAM(PictureInStream);
TempBlob.DELETEALL;
TempBlob.INIT;
TempBlob.Blob.CREATEOUTSTREAM(PicOutStream);
COPYSTREAM(PicOutStream,PictureInStream);
TempBlob.INSERT;
TempBlob.CALCFIELDS(Blob);
PictureText.ADDTEXT(TempBlob.ToBase64String);
END;
//RWN

Return this Picturetext in Web-service and they have to convert it from Base 64 string, they will have the real image.

Item Record Item
TenantMedia Record Tenant Media
PictureText BigText
PictureInStream InStream
TempBlob Record TempBlob

CHEERS

Permission Set – Security Filter

 

Hey Friends,

May be you all are aware about this feature in Permission Set which say Security Filter!! I just used and wanted to share this to you as this will add an extra security layer to your permission set. This basically works on field level, say you want to introduce one permission set and that permission should explicitly make the user to see only those records in Sales Order for which Salesperson code = SR,

Here’s how you can achieve this, Just navigate to Architectural Window./Departments/Administration/IT Administration/General/Permission Sets  and then hit permissions in the Action bar. Here you will find all set objects that has been introduced, just simply navigate to Sales Header and in the right side you will see security filters

 

Assist edit on this and then it will take you to new window which will give you the list of the Fields of that table and then you can apply your specific filter on any of the defined field.

 

Hit OK and you are done. Just apply this Role to any of the user and then cross verify!!

CHEERS

Soap Service – Special Characters

 

Hey Folks,

We all know SOAP Services has it’s own Protocol while commuting over different Platforms. Sometimes Client is willing to send special characters for there own reasons over web service but it is not permitted within SOAP protocols.

Here is the way how you can make this accessible with a tweak, while calling service replace this special characters with:

< is converted to &lt;

> is converted to &gt;

& is converted to &amp;

is converted to &quot;

Now at the other end you just need to decode it to get back the original special character that you have. Here is the code you need to write-

//RWN
Bigtext.ADDTEXT(DecodeSpecialCharacter.HtmlDecode(InputBigtext));
//RWN

Here Bigtext will have decoded value coming in InputBigtext.

DecodeSpecialCharacter    DotNet     System.Net.WebUtility.’System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089′

CHEERS

 

Debit Credit Concept – Accounting

 

Hey Friends,

I know there’s always been a confusion to understand this Accounting concept like which account gets Credited and exactly which will get Debited as there’s no generic sign for Debit and Credit. Sometimes Debit means Positive (+) and sometimes it means Negative (-) and the same goes vice versa for Credit. So I just made this small structure which will help you understand when Debit means positive and for which Account Type and the same for Credit.

 

 

 

 

 

 

Here Account Type means either its a Balance Sheet or Income Statement. Debit (+) means this Account will get Debited with a + value and Credit will be in -. The same way this will get Credited + means this Account will be Credited with a  + value and Debit will be in -.

I wrote DEALER on the top because it will make easier for you to remember the Accounts. First three DEA means Draw, Expense and Asset and last 3 LER means Liability, Equity and Revenue.

CHEERS

Disable Sorting – List Page

 

Hey Friends,

Recently I got a requirement where client asked me to disable Sorting. They don’t want any user to rearrange the data based on any field.  Here is just what needs to be done.

Open list page and navigate to Repeater Property –  Here you will find IndentationColumnName property. Just change it to 0 and we are done.

There are many properties in multiples places across NAV which we don’t bother to experience but it can literally make our life easier.

CHEERS

Cross Reference No – Item

 

Hey Friends,

There’s many features in standard NAV which we normally don’t use, not because we don’t want to but just because we are not aware. Item Cross Reference is one of the out of the box feature which I belief is rarely used by the end users but it’s really an awesome one for them to use in there day to day data entry process. The basic benefit of this is you don’t have to look for Item No every time, just your unique reference and it will automatically bring the respective item, Variant and so on.

So here’s what you need to do – Open Item List

Here as highlighted in screenshot you need to open Cross Reference and do the respective setup’s. This you need to do for each and every Item. So here we are doing for Item I000009.

Here you need to put the Customer No for the Customer’s you want to do along with the Variant and Unit of Measure Codes. Cross Ref No will be the key to identify this.

Now you need to navigate to Sales Order and you are supposed to make the new one.

Now as you see the screenshot we took the same customer for which we did the setup, Now we need to navigate to Line Items and push the drop down for Cross Reference No. Generally Cross Reference No is not visible so you need to choose it from Choose Columns. So once you hit the Drop Down you will have the list of Cross Reference’s that you did the setup for. Now you just have to hit OK and you will have your line item ready.

So by this you don’t have to look for your Item No every time. Just one setup as per your convenience and you are good to go.

CHEERS